package com.aiyige.model.moment.entity;

import android.text.TextUtils;

import com.aiyige.city.model.City;
import com.aiyige.model.moment.backup.CardBackup;
import com.aiyige.model.moment.backup.DetailBackup;
import com.aiyige.utils.DummyDataUtil;
import com.aiyige.utils.TimeUtils;

import java.util.List;

public class MajorCourse {


    private String id;

    /**
     * 价格，单位：元
     */
    private Double price;
    /**
     * 原价，单位：元
     */
    private Double originPrice;
    /**
     * 单次价格，单位：元
     */
    private Double unitPrice;
    /**
     * 分成比例
     */
    private Double divisionProportion;
    /**
     * 开课起始时间，毫秒
     */
    private Long startDate;
    /**
     * 开课结束时间，毫秒
     */
    private Long endDate;
    /**
     * 课时总数
     */
    private Integer classCount;
    /**
     * 上课时长，单位：分钟
     */
    private Integer druationPerClass;
    /**
     * 开班条件，1-确定日期开班，2-人满开班，大于最低招生人数，3-随到随学
     */
    private Integer takeEffectCondition;
    /**
     * 开班条件的确定开班日期
     */
    private Long confirmStartClassDate;
    /**
     * 招生人数
     */
    private Integer studentMax;
    /**
     * 开班条件的最低招生人数
     */
    private Integer studentMin;
    /**
     * 上课教室ID
     */
    private String classroomId;
    /**
     * 教室地址
     */
    private String classroomSumary;
    /**
     * 图文详情
     */
    private DetailBackup detail;
    /**
     * 图文说明转换为HTML
     */
    private String detailHtml;
    /**
     * 图文说明是否可在APP上编辑
     */
    private Boolean detailCanEditOnApp;
    /**
     * 课程表
     */
    private List<Content> timetable;
    /**
     * 课程表转换为HTML
     */
    private String timetableHtml;
    /**
     * 课程表是否可在APP上编辑
     */
    private Boolean timetableCanEditOnApp;
    /**
     * 封面集（包括图片和视频）
     */
    private List<Content> coverSet;
    /**
     * 可用培训卡列表
     */
    private List<CardBackup> bindCardBackup;
    /**
     * 课程说明富文本
     */
    private String richText;
    /**
     * 课程表富文本
     */
    private String timetableRichText;
    /**
     * 富文本中的视频转码用的持久化列表
     */
    private List<PersistentMapping> persistentMappings;

    private String suitablePopulation;

    private String learningGoals;

    private String learningAges;

    private Boolean consumptionGuarantee;

    public Boolean getConsumptionGuarantee() {
        return consumptionGuarantee;
    }

    public void setConsumptionGuarantee(Boolean consumptionGuarantee) {
        this.consumptionGuarantee = consumptionGuarantee;
    }

    public String getSuitablePopulation() {
        return suitablePopulation;
    }

    public void setSuitablePopulation(String suitablePopulation) {
        this.suitablePopulation = suitablePopulation;
    }

    public String getLearningGoals() {
        return learningGoals;
    }

    public void setLearningGoals(String learningGoals) {
        this.learningGoals = learningGoals;
    }

    public String getLearningAges() {
        return learningAges;
    }

    public void setLearningAges(String learningAges) {
        this.learningAges = learningAges;
    }

    public String getRichText() {
        return richText;
    }

    public void setRichText(String richText) {
        this.richText = richText;
    }

    public String getTimetableRichText() {
        return timetableRichText;
    }

    public void setTimetableRichText(String timetableRichText) {
        this.timetableRichText = timetableRichText;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public Double getPrice() {
        return price;
    }

    public void setPrice(Double price) {
        this.price = price;
    }

    public Double getOriginPrice() {
        return originPrice;
    }

    public void setOriginPrice(Double originPrice) {
        this.originPrice = originPrice;
    }

    public Double getUnitPrice() {
        return unitPrice;
    }

    public void setUnitPrice(Double unitPrice) {
        this.unitPrice = unitPrice;
    }

    public Double getDivisionProportion() {
        return divisionProportion;
    }

    public void setDivisionProportion(Double divisionProportion) {
        this.divisionProportion = divisionProportion;
    }

    public Long getStartDate() {
        return startDate;
    }

    public void setStartDate(Long startDate) {
        this.startDate = startDate;
    }

    public Long getEndDate() {
        return endDate;
    }

    public void setEndDate(Long endDate) {
        this.endDate = endDate;
    }

    public Integer getClassCount() {
        return classCount;
    }

    public void setClassCount(Integer classCount) {
        this.classCount = classCount;
    }

    public Integer getDruationPerClass() {
        return druationPerClass;
    }

    public void setDruationPerClass(Integer druationPerClass) {
        this.druationPerClass = druationPerClass;
    }

    public Integer getTakeEffectCondition() {
        return takeEffectCondition;
    }

    public void setTakeEffectCondition(Integer takeEffectCondition) {
        this.takeEffectCondition = takeEffectCondition;
    }

    public Long getConfirmStartClassDate() {
        return confirmStartClassDate;
    }

    public void setConfirmStartClassDate(Long confirmStartClassDate) {
        this.confirmStartClassDate = confirmStartClassDate;
    }

    public Integer getStudentMax() {
        return studentMax;
    }

    public void setStudentMax(Integer studentMax) {
        this.studentMax = studentMax;
    }

    public Integer getStudentMin() {
        return studentMin;
    }

    public void setStudentMin(Integer studentMin) {
        this.studentMin = studentMin;
    }

    public String getClassroomId() {
        return classroomId;
    }

    public void setClassroomId(String classroomId) {
        this.classroomId = classroomId;
    }

    public String getClassroomSumary() {
        return classroomSumary;
    }

    public void setClassroomSumary(String classroomSumary) {
        this.classroomSumary = classroomSumary;
    }

    public DetailBackup getDetail() {
        return detail;
    }

    public void setDetail(DetailBackup detail) {
        this.detail = detail;
    }

    public String getDetailHtml() {
        return detailHtml;
    }

    public void setDetailHtml(String detailHtml) {
        this.detailHtml = detailHtml;
    }

    public Boolean getDetailCanEditOnApp() {
        return detailCanEditOnApp;
    }

    public void setDetailCanEditOnApp(Boolean detailCanEditOnApp) {
        this.detailCanEditOnApp = detailCanEditOnApp;
    }

    public List<Content> getTimetable() {
        return timetable;
    }

    public void setTimetable(List<Content> timetable) {
        this.timetable = timetable;
    }

    public String getTimetableHtml() {
        return timetableHtml;
    }

    public void setTimetableHtml(String timetableHtml) {
        this.timetableHtml = timetableHtml;
    }

    public Boolean getTimetableCanEditOnApp() {
        return timetableCanEditOnApp;
    }

    public void setTimetableCanEditOnApp(Boolean timetableCanEditOnApp) {
        this.timetableCanEditOnApp = timetableCanEditOnApp;
    }

    public List<Content> getCoverSet() {
        return coverSet;
    }

    public void setCoverSet(List<Content> coverSet) {
        this.coverSet = coverSet;
    }

    public List<CardBackup> getBindCardBackup() {
        return bindCardBackup;
    }

    public void setBindCardBackup(List<CardBackup> bindCardBackup) {
        this.bindCardBackup = bindCardBackup;
    }

    public String getCityName(String cityId) {
        String cityName = "";
        try {
//            if (!TextUtils.isEmpty(classroomSumary) && classroomSumary.contains(" ")) {
//                String provinceCity[] = classroomSumary.split(" ");
//                cityName = provinceCity[1];
//            }
            if (!TextUtils.isEmpty(cityId)) {
                City city = DummyDataUtil.getCityById(cityId);
                if (city != null) {
                    cityName = city.getCity();
                }
            }
        } catch (Exception e) {

        }
        return cityName;
    }

    public String getStartClassTime() {
        try {
            return TimeUtils.dateToYYYYMMDD(startDate);
        } catch (Exception e) {
            return "";
        }
    }

    public String getEndClassTime() {
        try {
            return TimeUtils.dateToYYYYMMDD(endDate);
        } catch (Exception e) {
            return "";
        }
    }

    public List<PersistentMapping> getPersistentMappings() {
        return persistentMappings;
    }

    public void setPersistentMappings(List<PersistentMapping> persistentMappings) {
        this.persistentMappings = persistentMappings;
    }
}
